<%-- 
    Document   : reportes
    Created on : 08/15/2013, 09:23:26 PM
    Author     : grakeskull
--%>

<%@page import="edu.capex.farmacus.Manager.VisitadoresMedicosManager"%>
<%@page import="edu.capex.farmacus.encapsulates.Visitadoresmedicos"%>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>

<html>
    <%
        if (request.getParameter("imprimir") != null) {
    %>
    <body class="preview" data-spy="scroll" data-target=".subnav" data-offset="80">

        <div class="container">
            <center>
                <h2>Reportes de Visitadores</h2>
                <table id="myTable" class="table table-bordered table-striped" border="1">
                    <thead>
                        <tr>
                            <th filter-type="ddl">
                                Visitador
                            </th>
                            <th filter-type="ddl">
                                Medico
                            </th>
                            <th filter-type="ddl">
                                Reporto
                            </th>
                            <th>
                                Observacion
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            for (Visitadoresmedicos temp : new VisitadoresMedicosManager().findVisitadoresmedicosEntities()) {
                                if (temp.getReporto()) {
                        %>
                        <tr>
                            <td>
                                <%=temp.getVisitadores().getNombre()%>
                            </td>
                            <td>
                                <%=temp.getMedicos().getNombre()%>
                            </td>
                            <td>
                                <%=temp.getReporto() ? "Si" : "No"%>
                            </td>
                            <td>
                                <%=temp.getComentario()%>
                            </td>
                        </tr>
                        <%
                                }
                            }
                        %>
                    </tbody>
                </table>
            </center>
        </div>
        <script type="text/javascript">
            $(document).ready(function() {
                $("#myTable").tableFilter();
            });
        </script>
    </body>
    <%} else {%>
    <head>
        <%@include file="/resources/header.jsp" %>
        <script src="../js/bsa.js"></script>
    </head>
    <%@include file="/resources/header1.jsp" %>
    <body class="preview" data-spy="scroll" data-target=".subnav" data-offset="80">

        <div class="container">

            <%@include file="/admin/supervisores/menuadm.jsp" %>

            <h2>Reportes</h2>
            <section id="buttons">

                <form action="#" method="POST">
                    <input type="submit" name="imprimir" value="Imprimir"/>
                </form>
                <table id="myTable" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th filter-type="ddl">
                                Visitador
                            </th>
                            <th filter-type="ddl">
                                Medico
                            </th>
                            <th filter-type="ddl">
                                Reporto
                            </th>
                            <th>
                                Observacion
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <%
                            for (Visitadoresmedicos temp : new VisitadoresMedicosManager().findVisitadoresmedicosEntities()) {
                                if (temp.getReporto()) {
                        %>
                        <tr>
                            <td>
                                <%=temp.getVisitadores().getNombre()%>
                            </td>
                            <td>
                                <%=temp.getMedicos().getNombre()%>
                            </td>
                            <td>
                                <%=temp.getReporto() ? "Si" : "No"%>
                            </td>
                            <td>
                                <%=temp.getComentario()%>
                            </td>
                        </tr>
                        <%
                                }
                            }
                        %>
                    </tbody>
                </table>

            </section>
            <%@include file="/resources/footer1.jsp" %>
        </div>
        <script type="text/javascript">
            $(document).ready(function() {
                $("#myTable").tableFilter();
            });
        </script>
    </body>
    <%}%>
</html>
